<template>
  <el-menu
    default-active="1"
    :collapse="collapsed"
    collapse-transition
    router
    unique-opened
    class="el-menu-vertical-demo"
    background-color="#001529"
    text-color="#fff"
    active-text-color="#ffd04b"
  >
    <div class="logobox">
      <img
        class="logoimg"
        src="https://morefun-pepsi.oss-cn-beijing.aliyuncs.com/uploadFile/9552/%E7%99%BE%E4%BA%8Blogo.png"
        alt=""
      />
    </div>
    <el-menu-item v-for="menu in allmenu" :index="menu.url" :key="menu.menuid">
      <span slot="title">{{ menu.menuname }}</span>
    </el-menu-item>
     <!-- <el-submenu>
        <template slot="title">抽奖管理</template>
        <el-menu-item-group>
          <el-menu-item index="/config/luckDrawPage">奖池配置</el-menu-item>
          <el-menu-item index="/config/luckPrizePage">奖项配置</el-menu-item>
        </el-menu-item-group>
      </el-submenu> -->
  </el-menu>
</template>
<script>
// import { menu } from '../api/userMG'
export default {
  name: "leftnav",
  data() {
    return {
      collapsed: false,
      allmenu: [],
    };
  },

  created() {
    // 获取图形验证码
    let res = {
      success: true,
      data: [
        {
          menuid: 1,
          menuname: "导出数据",
          hasThird: null,
          url: "/config/exportPage",
        },
        {
          menuid: 3,
          menuname: "公告及图文链接配置",
          hasThird: null,
          url: "/config/configurePage",
        },
        {
          menuid: 6,
          menuname: "积分商城",
          hasThird: null,
          url: "/config/integralPage",
        },  
        {
          menuid: 7,
          menuname: "组合购列表",
          hasThird: null,
          url: "/config/addGoodsPage",
        },
        {
          menuid: 8,
          menuname: "组合购专属链路",
          hasThird: null,
          url: "/config/groupPage",
        },
        {
          menuid: 9,
          menuname: "抽奖管理",
          hasThird: null,
          url: "/config/luckDrawPage",
        },
      ],
      msg: "success",
    };
    this.allmenu = res.data;
  },
};
</script>
<style>
.el-menu-item.is-active {
  background-color: rgb(48, 105, 132) !important;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 240px;
  min-height: 1300px;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  border: none;
  text-align: left;
}
.el-menu-item-group__title {
  padding: 0px;
}
.el-menu-bg {
  background-color: #155bc8 !important;
}
.el-menu {
  border: none;
}
.logobox {
  height: 60px;
  line-height: 40px;
  color: #9d9d9d;
  font-size: 20px;
  margin-left: 20px;
  /* text-align: center; */
  padding: 20px 0px;
}
.logoimg {
  width: 80px;
  height: 80px;
}
.el-icon-arrow-down:before{
  display: none;
}
</style>